/*
 * Copyright (c) 2005 -2008 Reliable Source, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Mozilla Public License v.1.1,
 * BSD, and Eclipse Public License v1.0 which accompanies this
 * distribution and is available at:
 *
 * 		http://www.eclipse.org/legal/epl-v10.html
 * 		http://www.opensource.org/licenses/bsd-license.php
 * 		http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * Contributors:
 *     IBM Corporation	     -  http://ibm.com
 *     	- initial API and implementation
 *
 *     patientos.org         - http://patientos.org
 *     	- domain and database persistence layer
 *
 *     Reliable Source, Inc. - http://reliablesource.org
 *     	- Symbiosys Application Framework,
 *     	- Symbiosys Application, Symbiosys Product
 *
 */
package org.reliablesource.symbiosys.workbench.tests.menus;

import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.internal.PluginActionContributionItem;
import org.reliablesource.client.ui.symbiosys.platform.views.PatientListViewPart;

/**
 * AddPatientActionTest.java<br>
 * Created on: Jun 30, 2008<br>
 *
 * @author <a href="mailto:dennis.park@gmail.com">Dennis Park</a>
 *
 * @category
 * @since 1.0
 */
public class AddPatientActionTest extends SymbiosysViewActionContributionTest{

    /**
     * @param _testName
     * @category constructor
     */
    public AddPatientActionTest(String _testName) {
	super(_testName);
    }
    
    public void testAddPatientAction(){
	PatientListViewPart _part = (PatientListViewPart) fPage.getActivePart();
	IMenuManager _menuMgr =
	_part.getViewSite().getActionBars().getMenuManager();
	
	IContributionItem [] _menuItems = _menuMgr.getItems();
	for(int i = 0; i < _menuItems.length; i++){
	    
	    System.err.println("------------------------");
	    
	    if(_menuItems[i].isDynamic())
		System.err.println("is dynamic");
	    
	    if(_menuItems[i].isEnabled())
		System.err.println("is enabled");
	    
	    if( _menuItems[i].isSeparator()){
		System.err.println("is seperator");
	    }else{
		 PluginActionContributionItem _action = (PluginActionContributionItem) _menuItems[i];
		    _action.getAction().run();
	    }
	    
	    if(_menuItems[i].isVisible())
		System.err.println("is visible");
	    
	    System.err.println(_menuItems[i].getId());
	    System.err.println("------------------------");
	}
	
	
    }
    
}
